﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LibraryMIS_SE01
{
    /// <summary>
    /// 完成文本框的清空
    /// </summary>
    public class TextBoxClean
    {
        public TextBoxClean(Form form,Panel panel)
        {
            foreach(Control control in form.Controls)
            {
                if (control is TextBox)
                    ((TextBox)control).Clear();
            }
            foreach (Control control in panel.Controls)
            {
                if (control is TextBox)
                    ((TextBox)control).Clear();
            }
        }
        public TextBoxClean(Form form)
        {
            foreach (Control control in form.Controls)
            {
                if (control is TextBox)
                    ((TextBox)control).Clear();
            }            
        }
        public TextBoxClean(Panel panel)
        {
            foreach (Control control in panel.Controls)
            {
                if (control is TextBox)
                    ((TextBox)control).Clear();
            }
        }
        public TextBoxClean(GroupBox groupbox)
        {
            foreach (Control control in groupbox.Controls)
            {
                if (control is TextBox)
                    ((TextBox)control).Clear();
            }
        }

    }
}
